<template>
  <div class="box">
    次数<h1 @click="$router.push('Home')">
      {{num}}
    </h1>
  </div>
</template>

<script>
import {message} from "ant-design-vue"
import { text1 } from "../api/text.js";
export default {
  data(){
    return{
      num:0
    }
  },
  created() {
  const _this=this
   setInterval(async function (){
    const data = await text1()
    if(data.success){
      _this.num=_this.num+1
      message.success(data.msg)
    }else{
      message.error(data.msg)
    }

    console.log(data)
   },500)

    var item = {};
    window.sessionStorage.setItem("login", JSON.stringify(item));
  },
};
</script>

<style lang="less" scoped>
.box{
  // width: 100px;
  // height: 100px;
  // position: absolute;
  // top: 0;
  // right: 0;
  // left: 0;
  // bottom: 0;
  // margin: auto;
  padding-top: 10px;
  padding-left: 10px;
  text-align: left;
  }
  h1{
    color: red;
  }
</style>
